		function GetRequest() {   
			   var url = location.search; //获取url中"?"符后的字串   
			   var theRequest = new Object();   
			   if (url.indexOf("?") != -1) {   
			      var str = url.substr(1);   
			      strs = str.split("&");   
			      for(var i = 0; i < strs.length; i ++) {   
			         theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);   
			      }   
  			 }   
   			return theRequest;   
		} 
		
		layui.use(['upload','element','table','form','laytpl'],function(){ 
			var $ = layui.jquery ,
			upload = layui.upload ,
			table = layui.table ,
			layer = layui.layer ,
			element =layui.element ,
			form = layui.form ,
			laytpl=layui.laytpl
		
		$.ajax({
			type:"get",
			url:"http://localhost:8888/student/getStudentById",
			data:{"id":GetRequest().id},
			success:function(data){
				
				var data = data.data;
				
				$("#id").val(data.id)
				$("#name").val(data.name)
				$("#studentNo").val(data.studentNo)
				$("#major").val(data.major)
				$("#gradeInfo").val(data.gradeInfo)
				$("#classInfo").val(data.classInfo)				
			}
		});
		
		form.on('submit(submitStudent)',function(data){
			$.ajax({
				type:"post",
				url:"http://localhost:8888/student/edit",
				data:data.field,
				success:function(data){
					layer.open({
						content: '修改成功!',
						yes: function(index, layero) {											
							//do something
							 layer.close(index); //如果设定了yes回调，需进行手工关闭
						}
					});
				},
				error:function(){
					layer.msg("修改失败")
				}
			});
			return false;
		})
			
			
			
			
			
});